package kpu.SmartLibrary;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.kpu.R;

public class HelpActivity extends Activity implements OnClickListener {

	Button bt_p1_next, bt_p2_next, bt_p3_next, bt_p4_next, bt_p5_next;
	Button bt_p1_back, bt_p2_back, bt_p3_back, bt_p4_back, bt_p5_back;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.help_p1);

		bt_p1_next = (Button) findViewById(R.id.bt_p1_next);

		bt_p1_next.setOnClickListener(HelpActivity.this);
	}

	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == bt_p1_next || v == bt_p3_back) {
			setContentView(R.layout.help_p2);
			bt_p2_next = (Button) findViewById(R.id.bt_p2_next);
			bt_p2_back = (Button) findViewById(R.id.bt_p2_back);
			bt_p2_next.setOnClickListener(HelpActivity.this);
			bt_p2_back.setOnClickListener(HelpActivity.this);
		}

		if (v == bt_p2_back) {
			setContentView(R.layout.help_p1);

			bt_p1_next = (Button) findViewById(R.id.bt_p1_next);

			bt_p1_next.setOnClickListener(HelpActivity.this);
		}

		if (v == bt_p2_next || v == bt_p4_back) {
			setContentView(R.layout.help_p3);

			bt_p3_next = (Button) findViewById(R.id.bt_p3_next);
			bt_p3_back = (Button) findViewById(R.id.bt_p3_back);
			bt_p3_next.setOnClickListener(HelpActivity.this);
			bt_p3_back.setOnClickListener(HelpActivity.this);
		}

		if (v == bt_p3_next || v == bt_p5_back) {
			setContentView(R.layout.help_p4);

			bt_p4_next = (Button) findViewById(R.id.bt_p4_next);
			bt_p4_back = (Button) findViewById(R.id.bt_p4_back);
			bt_p4_next.setOnClickListener(HelpActivity.this);
			bt_p4_back.setOnClickListener(HelpActivity.this);
		}
		if (v == bt_p4_next) {
			setContentView(R.layout.help_p5);

			bt_p5_next = (Button) findViewById(R.id.bt_p5_next);
			bt_p5_back = (Button) findViewById(R.id.bt_p5_back);
			bt_p5_next.setOnClickListener(HelpActivity.this);
			bt_p5_back.setOnClickListener(HelpActivity.this);
		}
		if (v == bt_p5_next) {
			finish();
		}

	}

}
